package com.easyCms.base.dao;

import com.easyCms.base.entity.AppCheckCode;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;

import java.util.Date;

public interface AppCheckCodeDAO
        extends PagingAndSortingRepository<AppCheckCode, Long>, JpaSpecificationExecutor<AppCheckCode> {

    AppCheckCode findByPhoneNumberAndCheckCodeAndCheckCodeTypeAndStateAndExpireDateAfter(String phoneNumber,
                                                                                         String checkCode, Integer checkCodeType, Integer state, Date nowDate);

    AppCheckCode findByPhoneNumberAndCheckCodeAndCheckCodeTypeAndState(String phoneNumber, String checkCode,
                                                                       Integer checkCodeType, Integer state);

}
